<template>
	<view>
		<u-popup  v-model="shareshow" mode="center" width="90%" ref="auth" :mask-close-able="false" :custom="true" :mask-click="false" @close="closeshare">
            <view class="newpop">
                <view class="popone">
                    <image class="bg" :src="ossThree('/uploads/20250404/84754aa553fd80bbd0ca68851518fa33.png')" mode="" />
                    <view class="phonenav">
                        <text class="tuiname">推荐{{lei==2?'老板':'员工'}}来招工</text>
                        <text class="tuimiao">最高返您</text>
                        <text class="tuinum"><text class="tuinums">{{lei==2?yaotxt.yq_boss_jiang:yaotxt.yq_boss_gongren}}</text>元红包</text>
                        <view class="shaview">
                            <view class="shaitem">
                                <button open-type="share"  class="yaoleft">
                                    <image class="icon_weixin" src="/static/img/icon_weixin.png" mode="" @click="closeshare" />
                                    <text>微信好友</text>
                                </button>
                            </view>
                            <view class="shaitem" @click="getshare">
                                <image class="icon_weixin" src="/static/img/icon_pengyouquan.png" mode="" @click="closeshare" />
                                <text>朋友圈</text>
                            </view>
                        </view>
                    </view>
                </view>
                <image class="baiguan" src="/static/img/baiguan.png" mode="" @click="closeshare" />
            </view>
        </u-popup>
	</view>
</template>

<script>
 import {
		baseUrl
	} from '@/utils/config.js';
	export default {
		name: 'sharePop',
		props: {
			shareshow: {
				type: Boolean,
				default: false
			},
            yaotxt:{
                type:Object,
                default:{}
            },
            lei:{
                type:Number/String,
                default:1
            }

		},
		data() {
			return {
                jielist:[
                    {id:1,name:'都可以',istrue:true},
                    {id:2,name:'员工必须电话沟通后才能接单',istrue:false},
                    {id:3,name:'员工无需拨打电话，直接接单',istrue:false},
                ],
                identity:1

                
			};
		},
		created() {
			if(this.$store.state.identity == 2){
                //
                this.identity = 2
            }else{
                this.identity = 1
            }
		},
		mounted() {
		},
        onShareAppMessage(res) {
			if (res.from === 'button') { // 来自页面内分享按钮
				console.log(res.target);
			}
			return {
				title: '东方蓉妍',
				imageUrl:this.ossThree('/uploads/20250404/573dd121b664a0b0565b364c65a10f31.png'),
				path: '/pages/tabbar/index?invite_code='+this.$store.state.code||uni.getStorageSync('code')
			}
		},
		onShareTimeline(){
			return {
				title: '东方蓉妍',
				imageUrl:this.ossThree('/uploads/20250404/573dd121b664a0b0565b364c65a10f31.png'),
				path: '/pages/tabbar/index?invite_code='+this.$store.state.code||uni.getStorageSync('code')
			}
		},
		methods: {
            closeshare(){
                this.$emit("closeshare")
            },
            getjie(item){
                let jielist = this.jielist
                for(let i in jielist){
                    jielist[i].istrue = false
                    if(item.id == jielist[i].id){
                        jielist[i].istrue = true
                    }
                }
                this.jielist = jielist
            },
            getshare(){
				console.log("+++")
                this.$u.toast("点击右上角分享朋友圈即可");
				// uni.share({
				// 	title: '东方蓉妍',
                //     imageUrl:this.ossThree('/uploads/20250404/573dd121b664a0b0565b364c65a10f31.png'),
                //     path: '/pages/tabbar/index?invite_code='+this.$store.state.code||uni.getStorageSync('code'),
				// 	success: function (res) {
				// 		// that.popquxiao()
				// 		console.log("success:" + JSON.stringify(res));
				// 	},
				// 	fail: function (err) {
				// 		// that.popquxiao/()
				// 		console.log("fail:" + JSON.stringify(err));
				// 	}
				// });
			},
            

		}
	};
</script>

<style lang="scss" scoped>
    /deep/.u-mode-center-box{
        background-color: transparent;
    }
    .newpop{
        display: flex;
        flex-direction: column;
        // justify-content: center;
        align-items: center;
    }
    .gonglist{
        max-height: 800rpx;
        margin: 30rpx 0;
        .gongitem{
            background: #FFFFFF;
            border-radius: 30rpx;
            margin: 0 0 20rpx;
            padding: 30rpx;
            display: flex;
            flex-direction: row;
            align-items: center;
            .gleft{
                display: flex;
                flex-direction: column;
                .gname{
                    font-weight: 800;
                    font-size: 36rpx;
                    color: #111111;
                }
                .gmiao{
                    font-weight: 400;
                    font-size: 24rpx;
                    color: #999999;
                    max-width: 80%;
                    display: block;
                    margin-top: 10rpx;
                }
            }
            .quan{
                margin-left: auto;
                width: 38rpx;
                height: 38rpx;
            }
        }
    }
    .toubtn{
        height: 90rpx;
        background: linear-gradient(90deg, #FF8F39, #FF4D43);
        border-radius: 45rpx;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 28rpx;
        color: #FFFFFF;
        width: 100%;
    }
    .baiguan{
        width: 40rpx;
        height: 40rpx;
        margin-top: 30rpx;
        pointer-events: auto !important;
    }
	.popone{
        width: 100%;
        // background: #F5F5F5;
        // border-radius: 30rpx 30rpx 0rpx 0rpx;
        height: 690rpx;
        position: relative;
        display: flex;
        padding: 0rpx 30rpx 0rpx;
        flex-direction: column;
        align-items: center;
        .tuiname{
            font-weight: bold;
            font-size: 56rpx;
            color: #BC430F;
            display: block;
            margin-top: 30rpx;
        }
        .tuimiao{
            font-weight: bold;
            font-size: 36rpx;
            color: #000000;
            display: block;
            margin: 20rpx 0 15rpx;
        }
        .tuinum{
            font-weight: bold;
            font-size: 36rpx;
            color: #FD554D;
        }
        .tuinums{
            font-weight: bold;
            font-size: 80rpx;
            color: #FD554D;
            position: relative;
            top: 6rpx;
            margin-right: 8rpx;
        }
        .bg{
            position: absolute;
            width: 100%;
            height: 100%;
            // border-radius: 30rpx 30rpx 0 0 ;
        }
        .icon_gbcha{
            width: 40rpx;
            height: 40rpx;
            margin-left: auto;
            position: absolute;
            right: 30rpx;
            top: 30rpx;
        }
        .shaview{
            background: #FFFFFF;
            border-radius: 30rpx;
            padding:20rpx 40rpx;
            width: 130%;
            margin-top: 90rpx;
            display: flex;
            flex-direction: row;
            justify-content: space-around;
            .shaitem{
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                position: relative;
                .icon_weixin{
                    width: 120rpx;
                    height: 120rpx;
                    margin-bottom: 5rpx;
                }
                text{
                    font-weight: bold;
                    font-size: 28rpx;
                    color: #333333;
                }
            }
        }
        .yuedu{
            height: 80rpx;
            display: flex;
            padding: 0 30rpx;
            align-items: center;
            .icon_xz_n{
                width: 36rpx;
                height: 36rpx;
                margin-right: 8rpx;
            }
            .xy{
                font-weight: 500;
                font-size: 20rpx;
                color: #999999;
                display: block;
                width: 90%;
            }
            .xyhu{
                color: rgba(234, 89, 24, 1);
            }
        }
        .kaolv{
            font-weight: bold;
            font-size: 28rpx;
            color: #666666;
            display: block;
            text-align: center;
            margin-top: 20rpx;
        }
        .phonenav{
            position: relative;
            // margin: 30rpx;
            display: flex;
            flex-direction: column;
            // justify-content: center;
            align-items: center;
            padding: 40rpx 30rpx;
            .img_aq{
                width: 173rpx;
                height: 211rpx;
                margin-bottom: 20rpx;
            }
            .jiename{
                font-weight: bold;
                font-size: 36rpx;
                color: #111111;
            }
            .jiemiao{
                display: block;
                font-weight: 400;
                font-size: 24rpx;
                color: #666666;
                margin-top: 10rpx;
            }
            .queren{
                font-weight: 400;
                font-size: 24rpx;
                color: #666666;
                display: block;
                margin: 40rpx 0 80rpx;
            }
            .chaka{
                padding: 30rpx;
                width: 100%;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                background: #F6F7F9;
                border-radius: 16rpx;
                margin: 25rpx 0;
                .chaname{
                    font-weight: bold;
                    font-size: 28rpx;
                    color: #111111;
                }
                .phonenum{
                    display: block;
                    font-weight: bold;
                    font-size: 50rpx;
                    color: #F06047;
                    margin: 10rpx 0;
                }
                .xiugai{
                    display: flex;
                    flex-direction: row;
                    align-items: center;
                    .noben{
                        font-weight: 400;
                        font-size: 24rpx;
                        color: #666666;
                    }
                    .xiu{
                        font-weight: 400;
                        font-size: 24rpx;
                        color: #F06047;
                        display: inline-block;
                        margin-left: 6rpx;
                    }
                }
            }
            .dianbtn{
                height: 90rpx;
                background: linear-gradient(90deg, #FF8F39, #FF4D43);
                border-radius: 45rpx;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                width: 100%;
                margin-top: 20rpx;
                .bm{
                    font-weight: bold;
                    font-size: 28rpx;
                    color: #FFFFFF;
                }
                .bmmaio{
                    font-weight: 500;
                    font-size: 20rpx;
                    color: #FFFFFF;
                }
            }
            .bzhang{
                display: flex;
                flex-direction: row;
                align-items: center;
                margin-top: 30rpx;
                .icon_ts{
                    margin-right: 6rpx;
                    width: 24rpx;
                    height: 24rpx;
                }
                .zhiname{
                    font-weight: 400;
                    font-size: 20rpx;
                    color: #F06047;
                }
            }
        }
    }
    button::after {
		border: none;
	}
    .yaoleft{
        background-color: transparent;
        display: flex;
        width: 100%;
        height: 100%;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        line-height: normal;
        padding: 0;
        margin: 0;
    }
</style>
